home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / etc / kernel / postrm.d / initramfs-tools
Encoding:
Text File  |  2012-09-21  |  821 b   |  36 lines

  1. #!/bin/sh -e
  2.  
  3. version="$1"
  4. bootopt=""
  5.  
  6. [ -x /usr/sbin/update-initramfs ] || exit 0
  7.  
  8. # passing the kernel version is required
  9. if [ -z "${version}" ]; then
  10.     echo >&2 "W: initramfs-tools: ${DPKG_MAINTSCRIPT_PACKAGE:-kernel package} did not pass a version number"
  11.     exit 0
  12. fi
  13.  
  14. # exit if custom kernel does not need an initramfs
  15. if [ "$INITRD" = 'No' ]; then
  16.     exit 0
  17. fi
  18.  
  19. # absolute file name of kernel image may be passed as a second argument;
  20. # create the initrd in the same directory
  21. if [ -n "$2" ]; then
  22.     bootdir=$(dirname "$2")
  23.     bootopt="-b ${bootdir}"
  24. fi
  25.  
  26. # avoid running multiple times
  27. if [ -n "$DEB_MAINT_PARAMS" ]; then
  28.     eval set -- "$DEB_MAINT_PARAMS"
  29.     if [ -z "$1" ] || [ "$1" != "remove" ]; then
  30.         exit 0
  31.     fi
  32. fi
  33.  
  34. # delete initramfs
  35. INITRAMFS_TOOLS_KERNEL_HOOK=1 update-initramfs -d -t -k "${version}" ${bootopt} >&2
  36.